<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
    <th:block th:include="include :: header('修改采集任务信息')" />
    <th:block th:include="include :: datetimepicker-css" />
</head>
<body class="white-bg">
    <div class="wrapper wrapper-content animated fadeInRight ibox-content">
        <form class="form-horizontal m" id="form-task-edit" th:object="${collectionTask}">
            <input name="id" th:field="*{id}" type="hidden">
<!--            <div class="col-xs-12">-->
<!--                <div class="form-group">-->
<!--                    <label class="col-sm-3 control-label is-required">所属项目名称：</label>-->
<!--                    <div class="col-sm-8">-->
<!--                        <input name="projectName" th:field="*{projectName}" class="form-control" type="text" required>-->
<!--                    </div>-->
<!--                </div>-->
<!--            </div>-->
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">任务名称：</label>
                    <div class="col-sm-8">
                        <input name="taskName" th:field="*{taskName}" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">数据源：</label>
                    <div class="col-sm-8">
                        <input name="dataSource" th:field="*{dataSource}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label is-required">调度表达式：</label>
                    <div class="col-sm-8">
                        <input name="cronExpression" th:field="*{cronExpression}" class="form-control" type="text" required>
                    </div>
                </div>
            </div>
<!--            <div class="col-xs-12">-->
<!--                <div class="form-group">-->
<!--                    <label class="col-sm-3 control-label">触发时间，可记录最近一次触发时间：</label>-->
<!--                    <div class="col-sm-8">-->
<!--                        <div class="input-group date">-->
<!--                            <input name="triggerTime" th:value="${#dates.format(collectionTask.triggerTime, 'yyyy-MM-dd')}" class="form-control" placeholder="yyyy-MM-dd" type="text">-->
<!--                            <span class="input-group-addon"><i class="fa fa-calendar"></i></span>-->
<!--                        </div>-->
<!--                    </div>-->
<!--                </div>-->
<!--            </div>-->
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">目标模型：</label>
                    <div class="col-sm-8">
                        <input name="targetTable" th:field="*{targetTable}" class="form-control" type="text">
                    </div>
                </div>
            </div>
            <div class="col-xs-12">
                <div class="form-group">
                    <label class="col-sm-3 control-label">执行 SQL 语句内容：</label>
                    <div class="col-sm-8">
                        <textarea  rows="20" name="executionSql" class="form-control">[[*{executionSql}]]</textarea>
                    </div>
                </div>
            </div>
        </form>
    </div>
    <th:block th:include="include :: footer" />
    <th:block th:include="include :: datetimepicker-js" />
    <script th:inline="javascript">
        var prefix = ctx + "system/task";
        $("#form-task-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-task-edit').serialize());
            }
        }

        $("input[name='triggerTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });
    </script>
</body>
</html>
